import request from '@/utils/request'

// 库位列表
export function locationList(data) {
  return request({
    url: 'stock/warehouseConfig/index',
    method: 'post',
    data: data
  })
}

// 库位Treelist
export function locationTree(param) {
  return request({
    url: 'stock/warehouseConfig/location',
    method: 'get',
    param
  })
}

// 库位添加
export function locationAdd(data) {
  return request({
    url: 'stock/warehouseConfig/create',
    method: 'post',
    data: data
  })
}

// 库位批量添加
export function locationBatchCreate(data) {
  return request({
    url: 'stock/warehouseConfig/batch_create',
    method: 'post',
    data: data
  })
}

// 库位查询数量
export function locationSearchNum(id) {
  return request({
    url: 'stock/warehouseConfig/get_warehouse_config_info/' + id,
    method: 'get'
  })
}

// 库位修改
export function locationEdit(data) {
  return request({
    url: 'stock/warehouseConfig/update',
    method: 'post',
    data: data
  })
}

// 库位删除
export function locationDel(data) {
  return request({
    url: 'stock/warehouseConfig/delete',
    method: 'post',
    data: data
  })
}

// 查询库位列表
export function getLocation(data) {
  return request({
    url: 'stock/warehouseConfig/getWarehouseConfig',
    method: 'post',
    data: data
  })
}

// 库存列表
export function stockList(data) {
  return request({
    url: 'stock/stock/index',
    method: 'post',
    data: data
  })
}

// 库存添加(一键入库)
export function stockAdd(data) {
  return request({
    url: 'stock/stock/create',
    method: 'post',
    data: data
  })
}

// 库存添加(取消入库)
export function stockDel(data) {
  return request({
    url: 'stock/stock/delete',
    method: 'post',
    data: data
  })
}

// 库存(拆箱)列表
export function boxList(data) {
  return request({
    url: 'stock/box/index',
    method: 'post',
    data: data
  })
}

// 库存(拆箱)修改
export function boxEdit(data) {
  return request({
    url: 'stock/box/update',
    method: 'post',
    data: data
  })
}

// 库存(拆片)列表
export function sliceList(data) {
  return request({
    url: 'stock/slice/index',
    method: 'post',
    data: data
  })
}

// 库存(拆片)修改
export function sliceEdit(data) {
  return request({
    url: 'stock/slice/update',
    method: 'post',
    data: data
  })
}

// 拣货列表
export function pickList(data) {
  return request({
    url: 'stock/pick/index',
    method: 'post',
    data: data
  })
}
// 快速出库列表
export function pickFast(data) {
  return request({
    url: 'stock/pick/fast',
    method: 'post',
    data: data
  })
}

// 锁定拣货
export function pickAdd(data) {
  return request({
    url: 'stock/pick/create',
    method: 'post',
    data: data
  })
}

// 拣货(删除锁定)
export function pickDel(data) {
  return request({
    url: 'stock/pick/delete',
    method: 'post',
    data: data
  })
}

// 移库列表
export function moveList(data) {
  return request({
    url: 'stock/move/index',
    method: 'post',
    data: data
  })
}
// 移库添加
export function moveCreate(data) {
  return request({
    url: 'stock/move/create',
    method: 'post',
    data: data
  })
}
// 移库修改
export function moveUpdate(data) {
  return request({
    url: 'stock/move/update',
    method: 'post',
    data: data
  })
}
// 移库删除
export function moveDelete(data) {
  return request({
    url: 'stock/move/delete',
    method: 'post',
    data: data
  })
}

export function moveSure(data) {
  return request({
    url: 'stock/move/move',
    method: 'post',
    data: data
  })
}

export function moveAllSure(data) {
  return request({
    url: 'stock/move/moveAll',
    method: 'post',
    data: data
  })
}
// 库存列表
export function getStock(data) {
  return request({
    url: 'stock/move/getStock',
    method: 'post',
    data: data
  })
}

// 盘点列表
export function inventoryList(data) {
  return request({
    url: 'stock/inventory/index',
    method: 'post',
    data: data
  })
}
// 盘点添加
export function inventoryCreate(data) {
  return request({
    url: 'stock/inventory/create',
    method: 'post',
    data: data
  })
}
// 盘点修改
export function inventoryUpdate(data) {
  return request({
    url: 'stock/inventory/update',
    method: 'post',
    data: data
  })
}
// 盘点删除
export function inventoryDelete(data) {
  return request({
    url: 'stock/inventory/delete',
    method: 'post',
    data: data
  })
}
// 盘点明细列表
export function inventorySonList(data) {
  return request({
    url: 'stock/inventory/indexSon',
    method: 'post',
    data: data
  })
}

// 盘点明细修改
export function inventorySonUpdate(data) {
  return request({
    url: 'stock/inventory/sonUpdate',
    method: 'post',
    data: data
  })
}

// 库位信息
export function seatList(data) {
  return request({
    url: 'stock/stock/seatList',
    method: 'post',
    data: data
  })
}

export function getkcLocation(data) {
  return request({
    url: '/storehouse/tray/conversionList',
    method: 'post',
    data: data
  })
}

export function att(data) {
  return request({
    url: 'stock/warehouseConfig/att',
    method: 'post',
    data: data
  })
}

export function getSon(data) {
  return request({
    url: 'stock/warehouseConfig/getSon',
    method: 'post',
    data: data
  })
}

export function loacalConfig(data) {
  return request({
    url: 'stock/warehouseConfig/loacalConfig',
    method: 'post',
    data: data
  })
}

// 托盘添加
export function createAdd(data) {
  return request({
    url: 'storehouse/tray/createAdd',
    method: 'post',
    data: data
  })
}

// 锁定列表
export function lockList(data) {
  return request({
    url: 'stock/locking/index',
    method: 'post',
    data: data
  })
}

export function exportStock(data) {
  return request({
    url: 'stock/stock/exportStock',
    method: 'post',
    data
  })
}

export function clearLock(data) {
  return request({
    url: 'stock/locking/delAll',
    method: 'post',
    data
  })
}

export function statusEdit(data) {
  return request({
    url: 'stock/stock/statusEdit',
    method: 'post',
    data
  })
}

export function getMoveMain(data) {
  return request({
    url: 'stock/moveMain/index',
    method: 'post',
    data
  })
}

export function MoveMainCreate(data) {
  return request({
    url: 'stock/moveMain/create',
    method: 'post',
    data
  })
}

export function upTray(data) {
  return request({
    url: 'stock/stock/upTray',
    method: 'post',
    data
  })
}

// 拆箱修改
export function split(data) {
  return request({
    url: 'stock/move/split',
    method: 'post',
    data
  })
}

export function statement(data) {
  return request({
    url: 'stock/inventory/statement',
    method: 'get',
    params: data
  })
}

export function commodityInventory(id) {
  return request({
    url: 'stock/inventory/commodityInventory/' + id,
    method: 'get'
  })
}

export function statementCreate(data) {
  return request({
    url: 'stock/inventory/statementCreate',
    method: 'post',
    data
  })
}

export function pickWholeOut(data) {
  return request({
    url: 'stock/pick/wholeOut',
    method: 'post',
    data
  })
}

export function batchStatusEdit(data) {
  return request({
    url: 'stock/stock/batchStatusEdit',
    method: 'post',
    data
  })
}

// 导出库存统计表
export function exportStatement(data) {
  return request({
    url: 'stock/inventory/exportStatement',
    method: 'post',
    data: data
  })
}
